﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Hotnet.Entity;
using Hotnet.Entity.View;

namespace Hotnet.Web.Utility
{
	public class VideoHelper
	{
		public static string GetPlayUrl(Video video)
		{
			if (video.IsCanPlayInner == null || !video.IsCanPlayInner.Value)
				return "/VideoIntroduce/index/"+video.VideoID;
			return GetPlayUrl(video.IsGroup, video.VideoID);
		}

		public static string GetPlayUrl(ViewVideoList videoList)
		{
			if (videoList.IsCanPlayInner == null || !videoList.IsCanPlayInner.Value)
				return "/VideoIntroduce/index/" + videoList.VideoID;
			return GetPlayUrl(videoList.IsGroup, videoList.VideoID);
		}

		public static string GetPlayUrl(ViewListVideo video)
		{
			return GetPlayUrl(video.IsGroup, video.VideoID);
		}


		public static string GetPlayUrl(bool? isGroup, int videoID)
		{
			if (isGroup != null && isGroup.Value)
				return "/GroupVideoPlay/index/" + videoID;
			return "/SingleVideoPlay/index/" + videoID;
		}
	}
}
